home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11459 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  918 b 

  1. Path: ix.netcom.com!netnews
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Different "new" in g++ and TC++
  5. Date: 14 Mar 1996 17:56:00 GMT
  6. Organization: Netcom
  7. Message-ID: <4i9mjg$2m1@cloner3.netcom.com>
  8. References: <3148391A.4646@numerik.uni-kiel.de>
  9. NNTP-Posting-Host: den-co7-20.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Thu Mar 14  9:56:00 AM PST 1996
  13. X-Newsreader: WinVN 0.99.7
  14.  
  15. >A is a class with constructor A::A() and n is an
  16. >integer, apparently g++ and TC++ 3.0 do different jobs
  17. >on the expression "new A[n]": TC++ calls the constructor
  18. >apparently for every created object, while g++ does not.
  19.  
  20. TC++ is correct.  See ARM section 5.3.3, page 61:
  21.  
  22.     "Arrays of objects... if the class has a default constructor. (12.1)
  23.     In that case, the default constructor will be called for each
  24.     element of the array"
  25.  
  26. john lilley
  27.  
  28.